/**
 * Created with IntelliJ IDEA.
 * Description:
 */
public class Demo5 {
    public static void main(String[] args) throws InterruptedException {
        Thread thread =new Thread(()->{
            while (true){
                System.out.println("Thread线程打印");
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        });
        thread.start();
        while(true){
            System.out.println("main线程打印");
            Thread.sleep(1000);
        }
    }
}
